package org.sang.constant;

public enum GenderEnum {
    MALE("男", 1),
    FEMALE("女", 2);

    private int value;
    private String name;

    GenderEnum(String name, int value) {
        this.value = value;
        this.name = name;
    }

    public static String getName(int value) {
        for (GenderEnum v : GenderEnum.values()) {
            if (v.getValue() == value) {
                return v.name;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
